<template>
	<view class="container">
		<!--为了让切回列表页面 页面还停留在初始页面所以需加个空div-->
		<!-- <div style="height:44px"></div>  -->
        <div id="map" style="height: 100%;"></div> 
	</view>
</template>

<script>
	import mapTool from '../../assets/js/maptool.js'
	export default {
		props:["pointList"],
        watch: {
        	pointList(newValue){
        		console.log(newValue)
				mapTool.randerMarker(newValue)
        	},
        },
		data() {
			return {
				//keyword: '',
				//key:'39a1396deb82eb6f13efe26f291e7007',
			}
		},
		methods: {	
			//请求坐标
			 // requestgetmap() {	
				//  var param = {
				//  	search: this.keyword,
				//  	districtCode:this.districtCode,
				//  	monitorType:this.monitorType
				//    };	
				//  this.$api.reqApi.alarm(param).then(res => {
				//  	if (res.code === "success") {
				//  		var list = res.data;
				// 		 mapTool.randerMarker(list)
				//  	}
				//  })
			 // },	
		},
		mounted(){
			   // setTimeout(function(){
				   mapTool.initMap();  
			   // },200)
			   if(this.pointList.length>0){
				    // mapTool.randerMarker(this.pointList)
			   }
			   // mapTool.randerMarker(list)
			 //   console.log(this.currentData)
			 // if(this.currentData.length==0){  //从地图图标点进地图
				//  // alert('全部')
				//   this.requestgetmap()
			 // }else{                    //从列表点进地图 只有一个点位
				// // alert('当前')
				//  mapTool.currentMarker(this.currentData,this.currentData.equipName)
			 // }
		},
		destroyed() {
			//销毁地图
			mapTool.destroyMap()
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		// padding: 20px;
		font-size: 14px;
		line-height: 24px;
		animation: fadeInRight 0.4s 0s both;
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;

		.content-wrapper {
			// padding: 0 32rpx;
			height: 100%;
		}
	}
	         
	::v-deep .amap-marker-label{
		border-color: #6d6c6a;
		background-color: #fbfbfb;
		-webkit-box-shadow: 0px -3px 21px -7px #464141 inset;
		-moz-box-shadow: 0px -3px 21px -7px #464141 inset;
		box-shadow: 0px -3px 21px -7px #464141 inset;
		border-radius: 4px;
		.info{
			padding: 8rpx;
			position: relative;
		    i {
		        position: absolute;
				bottom: -23px;
				left: 50%;
				margin-left: -3px;
				content: '';
				border-bottom: 10px transparent dashed;
				border-left: 5px transparent dashed;
				border-right: 5px transparent dashed;
				border-top: 10px #313131 solid;
		    	&:before{
		    		position: absolute;
					bottom: -8px;
					left: 0;
					margin-left: -5px;
					content: '';
					border-bottom: 10px transparent dashed;
					border-left: 5px transparent dashed;
					border-right: 5px transparent dashed;
					border-top: 10px #D6D5D5 solid;
		    	}
		    }
		}
	}
</style>
